<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>文章列表</h1>
	<div class="buttons">
	{if ican('artindex')}
	<a href="{url admin.php?m=article}">文章列表</a>
	{/if}
	{if ican('artwrite')}
	<a href="{url admin.php?m=article&f=write}" >撰写文章</a>
	{/if}
	{if ican('catindex')}
	<a href="{url admin.php?m=category}" >文章类别</a>
	{/if}
	</div>
	</div>
	<div class="main">

		<div class="search">
			<form name="search" method="get" action="{url admin.php}" autocomplete="off">
			<input type="hidden" name="m" value="article" />
			<input type="hidden" name="f" value="index" />
				<fieldset>
					<legend>文章查找</legend>
						分类：
						<select name="cid">
							<option value="">所有分类</option>
						{get_category_options($cid)}
						</select>
						状态：
						<select name="status">
							<option value="">任意</option>
							{get_status_options($status)}
						</select>
						属性：
						<select name="property">
							<option value="">任意</option>
						{get_property_options($property)}
						</select>
						关键字：
						<input type="text" name="keyword" size="15" value="{urldecode($keyword)}" />
						<input type="submit" name="s" class="button" value="开始查找" />
						<input type="button" class="button" value="显示全部" onclick="javascript:window.location.href='{url admin.php?m=article}';" />
				</fieldset>
			</form>
		</div>

	<form name="op" method="post" action="{url admin.php?m=article}" autocomplete="off">
		<table cellspacing="0" class="list" id="list">
			<thead>
			<tr>
				<td width="1" class="center">
				<input type="checkbox" name="chkall1" value="1" class="checkbox" onclick="check_all(this)" />
				</td>
				<td width="50">
				{if getGP('order','G') == 'asc'}
				<a href="{$url}&order=desc" title="按ID从大到小排序">ID↑</a>
				{else}
				<a href="{$url}&order=asc" title="按ID从小到大排序">ID↓</a>
				{/if}
				</td>
				<td width="*">标题</td>
				<td width="80">作者</td>
				<td width="120" class="center">分类</td>
				<td width="60" class="center">
				{if getGP('view','G') == 'desc'}
				<a href="{$url}&view=asc" title="按阅读次数从少到多排序">阅读↓</a>
				{else}
				<a href="{$url}&view=desc" title="按阅读次数从多到少排序">阅读↑</a>
				{/if}
				</td>
				<td width="60" class="center">
				{if getGP('cmt','G') == 'desc'}
				<a href="{$url}&cmt=asc" title="按评论次数从少到多排序">评论↓</a>
				{else}
				<a href="{$url}&cmt=desc" title="按评论次数从多到少排序">评论↑</a>
				{/if}
				</td>
				<td width="150" class="center">时间</td>
			</tr>
			</thead>
			<tboby>
			{loop $result $row}
			<tr id="row_{$row['aid']}" {if $row['ischeck']}class="highlight"{/if}>
				<td class="center">
				<input type="checkbox" name="id[]" value="{$row['aid']}" class="checkbox" />
				</td>
				<td><a href="{url index.php?m=article&id=$row[aid]}" target="_blank">{$row['aid']}</a></td>
				<td class="left"><a href="{url admin.php?m=article&f=edit&id=$row[aid]}" title="编辑这篇文章">{cut_str($row['title'],50)}</a> 
				{if $row['status']==2}<span style="color:red">[锁定]</span>{/if}
				{if $row['status']==3}<span style="color:red">[隐藏]</span>{/if}
				{if $row['status']==4}<span style="color:red">[草稿]</span>{/if}
				
				{if $row['istop']}<span style="color:red">[置顶]</span>{/if}
				{if $row['iscommend']}<span style="color:red">[推荐]</span>{/if}
				{if !$row['ischeck']}<span style="color:red">[未审核]</span>{/if}
				{if !empty($row['password'])}<span style="color:red">[加密]</span>{/if}
				</td>
				<td align="center"><a href="{url $url&uid=$row[uid]}" title="只看该作者">{$row['username']}</a></td>
				<td align="center"><a href="{url $url&cid=$row[cid]}" title="只看该分类">{$row['catename']}</a></td>
				<td align="center"><b style="color:red">{$row['views']}</b></td>
				<td align="center"><a href="{admin.php?m=comment&aid=$row[aid]}" title="查看该文章下的评论"><b style="color:green">{$row['comments']}</b></a></td>
				<td align="center">{gdate('Y年m月d日',$row['dateline'])}</td>
			</tr>
			{/loop}
			<tr>
				<td align="center">
				<input type="checkbox" name="chkall2" value="1" class="checkbox" onclick="check_all(this)" /></td>
				<td class="center"><label for="chkall">全选</label></td>
				<td colspan="6" >{pager($num,$pagesize,$page,$url)}
				{if create_html()}
				<input type="radio" name="f" value="update" id="update" class="radio" /><label for="update">更新</label>
				{/if}
				{if ican('artcheck')}
				<input type="radio" name="f" value="check" id="check" class="radio" /><label for="check">审核</label> 
				<input type="radio" name="f" value="uncheck" id="uncheck" class="radio" /><label for="uncheck">不审核</label> 
				{/if}
				{if ican('artdelete')}
				<input type="radio" name="f" id="delete" value="delete" class="radio" /><label for="delete">删除</label>
				{/if}
				<input type="radio" name="f"  id="newstatus" value="newstatus" class="radio" /><label for="newstatus">状态</label> 
				<select name="status">
					{get_status_options()}
				</select>
				{if ican('artpromote')}
				<input type="radio" name="f"  id="newproperty" value="newproperty" class="radio" /><label for="newproperty">属性</label> 
				<select name="property">
					<option value="0">正常</option>
					{get_property_options($property)}
				</select>
				{/if}
				{if ican('arteditall')}
				<input type="radio" name="f" value="move" id="move" class="radio" /><label for="move">移动到</label> 
				<select name="cid">
					<option value="">请选择</option>
					{get_category_options($cid)}
				</select>
				{/if}
				{if ican('artpush')}
				<input type="radio" name="f" value="push" id="push" class="radio" /><label for="push">推送到</label> 
				<select name="blockid">{php $blocks=get_block('article')}
					<option value="">请选择</option>
					{loop $blocks $block}
					<option value="{$block['blockid']}">{$block['name']}</option>
					{/loop}
				</select>
				{/if}
				<input type="submit" class="button" value="执行操作" /></td>
			</tr>
			</tbody>
		</table>
	</div>
</div>
{admintemplate footer}